package com.cxc.chainOfResp;

/**
 * 主任审批
 */
public class Director extends Leader {

    public Director(String name) {
        super(name);
    }
    @Override
    public void handleRequest(LeaveRequest request) {
       if(request.getDay()<3){
           StringBuilder  sb = new StringBuilder();
                 sb.append("员工：").
                   append(request.getName()).
                   append("，请假").
                   append(request.getDay()).
                   append("天，请假原因：").
                   append(request.getReason()).
                   append("\n").
                   append("主任").
                   append(this.name).
                   append("审批通过");
           System.out.println(sb.toString());
       }else{
           if (this.nextLeader != null){
               this.nextLeader.handleRequest(request);
           }
       }
    }
}
